# 增加22点后不能玩的功能

def can_play(fn):
    def inner(person, game, *args, **kwargs):
        # print(args)
        # fn(person, game)
        if args[0] > 22:
            print('too later')
        else:
            print('{} is {} years old'.format(person, kwargs.get('age', 'Uknown')))
            fn(person, game)

    return inner


@can_play
def play(person, game):
    print('{} playing {}'.format(person, game))


play('peter', 'wzry', 19, age=16)
play('tom', 'dota', 23, age=23)
play('jerry', 'cat', 18)
